-
Notifications
You must be signed in to change notification settings - Fork 132
[Dynamic Dashboard] Navigate to reviews details from reviews card #11503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
// Open the review list screen first as it's responsible for handling review status changes | ||
navController.navigateSafely( | ||
DashboardFragmentDirections.actionDashboardToReviews() | ||
) | ||
// Continue to the details screen | ||
navController.navigateSafely( | ||
directions = DashboardFragmentDirections.actionGlobalReviewDetailFragment( | ||
launchedFromNotification = false, | ||
remoteReviewId = event.review.remoteId | ||
), | ||
skipThrottling = true | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ReviewListFragment
is responsible for handling the undo
logic of the reviews' operations (moderation and deletion), so to keep this logic while navigating from the reviews card, we needed to either:
- Implement the same logic at the dashboard level.
- Navigate to the list before showing the details.
For simplicity, I followed 2
, and it works well, please let me know what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice hack!
) : ScopedViewModel(savedStateHandle) { | ||
companion object { | ||
val supportedFilters = listOf( | ||
ProductReviewStatus.ALL, | ||
ProductReviewStatus.APPROVED, | ||
ProductReviewStatus.HOLD, | ||
ProductReviewStatus.SPAM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As explained here p1715612834620439/1715264194.676369-slack-C03L1NF1EA3, supporting the spam
filter will require more work, so let's remove it for now.
50692ba
to
442c79f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #11503 +/- ##
============================================
- Coverage 40.67% 40.65% -0.02%
Complexity 5180 5180
============================================
Files 1070 1070
Lines 62540 62569 +29
Branches 8557 8559 +2
============================================
Hits 25438 25438
- Misses 34815 34844 +29
Partials 2287 2287 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! 🏅
// Open the review list screen first as it's responsible for handling review status changes | ||
navController.navigateSafely( | ||
DashboardFragmentDirections.actionDashboardToReviews() | ||
) | ||
// Continue to the details screen | ||
navController.navigateSafely( | ||
directions = DashboardFragmentDirections.actionGlobalReviewDetailFragment( | ||
launchedFromNotification = false, | ||
remoteReviewId = event.review.remoteId | ||
), | ||
skipThrottling = true | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice hack!
Closes: #11474
Description
This PR adds logic for navigating to the review details from the reviews card, please check the comments for more details on the approach.
Testing instructions
Images/gif
Screen_recording_20240513_171822.mp4
RELEASE-NOTES.txt
if necessary. Use the "[Internal]" label for non-user-facing changes.